<?
include "include/config.php";
	
$id_oferta=addslashes($_GET['id_oferta']);
	
$limitPerPage=1;
$initLimit=0;

$startLimit = $_REQUEST['startLimit'];
$numberOfRows= $_REQUEST['rows'];

if ( $startLimit == "" ) $startLimit = $initLimit;
if ( $numberOfRows =="" ) $numberOfRows = $limitPerPage;

$nextStartLimit = $startLimit + $limitPerPage;
$previousStartLimit = $startLimit - $limitPerPage;

$limitQuery = " LIMIT ". $startLimit.",".$numberOfRows;

$smarty->assign('view',$id_pac);
$smarty->assign('startLimit',$startLimit);
$smarty->assign('nextStartLimit',$nextStartLimit);
$smarty->assign('previousStartLimit',$previousStartLimit);
$smarty->assign('limitPerPage',$limitPerPage);


$sql_main=mysql_query("select SQL_CALC_FOUND_ROWS src from `imagini` WHERE id_oferta='".$id_oferta."' ".$limitQuery."");
list($total_rows)=mysql_fetch_array (mysql_query("select FOUND_ROWS()")); $smarty->assign ('total_rows',$total_rows);

	while(list($img_rest)=mysql_fetch_array($sql_main))
	{
		$images_src[]=srvurl."imagini/mari/".$img_rest;
	}	
$smarty->assign("pics",$images_src);
     
	
echo $smarty->fetch(tmpd.'galerie'.tmpl_ext);
//include "include/make_page.php";
?>